<script type="text/javascript">
<!--

	// Funções Auxiliares

	function enableSubmit(){
		$("form.da-form div input[type=submit]").removeAttr("disabled");
	}

	function disableSubmit(){
		$("form.da-form div input[type=submit]").attr("disabled", "disabled");
	}

	function managementSubmit(element){
		if( element.val() != 0 )
			enableSubmit();
		else
			disableSubmit();
	}	
	
	$(document).ready(function(){
		
		// Listeners
		
		$("select#condominio").change(function(){
			managementSubmit( $(this) );
		});
		$("form.da-form").submit(function(event){
			var values = $(this).serialize();
			values = replaceAll(values, '=', '/');
			values = replaceAll(values, '&', '/');
			//alert( $(this).attr('action') + '/' + values );
			window.location = $(this).attr("action")+'/'+values;
			event.preventDefault(); // return false;
		});
		//$("form.da-form > div:nth-child(2)").hide(); // esconde o 2o filho(div) imediato de form.da-form
	
		// Inincializações
		
		if( "#{view.panel}" == "Listagem" )
			$("div#containerFiltro").hide();
		
		if( $("select#condominio").val() == 0 )
			disableSubmit();
		else
			enableSubmit();
		
	});
//-->
</script>
						<div class="grid_4" id="containerFiltro">
                        	<div class="da-panel">
                            	
                            	<div class="da-panel-header">
                                	<span class="da-panel-title">
                                        <img src="#{view.base}/web-files/images/icons/black/16/search.png" />
                                        Filtrar Clientes
                                    </span>
                                </div>
                                
                                <div class="da-panel-content">
                                
                                	<form class="da-form" method="post" action="#{view.base}/#{view.controller}/#{view.action}">
                                	
                                    	#{view.select.condominio}
                                	
                                        <div class="da-button-row" style="display: #{view.form.buttons.display};">
                                        	<input type="reset" value="Limpar" class="da-button gray left" /> 
                                        	<input type="submit" value="Filtrar" class="da-button green" />
                                        </div>
                                        
                                 	</form>
                                 	
                                </div>
                                
                            </div>
                        </div>    
                        
                        #{view.table.results}  